import {defineStore} from 'pinia';
import {RequestAPI} from "@/utils/RequestAPI";
import { MicroService } from '../build/MicroService'

export const DEVICE_TYPE = {
  PDA:1,
  DEVICE:2
}

export const useVersionStore = defineStore('VersionStore', {
  state() {
    return {
    }
  },
  actions: {
    async checkVersion() {
      let api = new RequestAPI({
        service:MicroService.COMMON
      })

      try {
        let res = await api.get(`system/version/getNewVersion/${DEVICE_TYPE.PDA}`, {

        });

        let {data} = res || {};
        console.log("[req checkVersion]->",res)

        return data;
      } catch (err) {
        console.log(err)
        throw new Error(err);
      }
    }
  }
})
